/* 比赛信息 */
import { getComps } from '@root/api/competition'
let competitions = []

/**
 * 加载比赛信息
 */
export function getCompetitions(init = false) {
  if (competitions.length === 0 || init) {
    return getComps({
      pageNum: 1,
      pageSize: 200
    }).then(res => {
      competitions = res.data.pageData
      return competitions
    })
  }
  return competitions
}
